import request from '@/utils/request'

/**
 * 分页查询数据
 * @param {Object} params
 */
export function dataListApi(params) {
  return request({
    url: '/api/dicttype/data',
    method: 'get',
    params
  })
}

export function findByIdApi(id) {
  return request({
    url: '/api/dicttype/'+id,
    method: 'get'
  })
}

// 新增字典类型
export function addApi(data) {
  return request({
    url: '/api/dicttype',
    method: 'post',
    data: data
  })
}

// 修改字典类型
export function editApi(data) {
  return request({
    url: '/api/dicttype',
    method: 'put',
    data: data
  })
}

// 删除字典类型
export function deleteApi(ids) {
  return request({
    url: '/api/dicttype/' + ids,
    method: 'delete'
  })
}


// 获取字典选择框列表
export function optionselect() {
  return request({
    url: '/api/dicttype/optionselect',
    method: 'get'
  })

}

//清空redis中数字缓存，并加载数据到缓存中
export function refreshCache(){
  return request({
    url: '/api/dicttype/refreshCache',
    method: 'get'
  })
}